<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>报表管理</title>
</head>
<lui:context/>
<u:View basePath="/res-system/report" userJS="report" delayLoadJs="false">
<body>
<lui:boards>
    <lui:board width="60%" boardTitle="报表管理">
        <form id="reportFrm" class='m-cust'>
		    <sys:dropCodeSet codeTypes="reportCategory" id="codeSet"/>
        	<div class="form-group row m-narrow">
			    <div class="col-sm-4 col-md-4 col-xs-4">
			    	<div class="input-group">
					    <label for="reportKey" class="input-group-addon">报表KEY</label>
					    <input name="reportKey" id="reportKey" type="text" class="form-control">
					</div>
			    </div>
			    <div class="col-sm-4 col-md-4 col-xs-4">
			    	<div class="input-group">
					    <label for="reportName" class="input-group-addon">报表名称</label>
					    <input name="reportName" id="reportName" type="text" class="form-control">
					</div>
			    </div>
			    <div class="col-sm-4 col-md-4 col-xs-4">
			    	<div class="input-group">
					    <label for="reportCategory" class="input-group-addon">所属业务</label>
						<lui:dropList id="reportCategory" name="reportCategory" className="form-control m-input" dropValues="codeSet.reportCategory" 
							showSelectAll="true" showSelectName="请选择"/>
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    </div>
			</div>
        	<div class="form-horizontal">
			    <div class="form-group">
			        <div class="col-md-12 col-sm-12">
			            <div class="btn-group">
			                <button type="button" class="btn btn-primary" onclick="ReportPage.findByCondition()"><i class='fa fa-fw fa-search'></i>查询</button>
			                <button type="button" class="btn btn-info" onclick="ReportPage.add()"><i class='fa fa-fw fa-plus'></i>新增</button>
			                <button type="reset" class="btn btn-default"><i class='fa fa-fw fa-repeat'></i>重置</button>
			            </div>
			        </div>
			    </div>
			</div>
			<u:dropListView id="dropView_oper">
			    <u:dropView name="update" template="edit" onClick="ReportPage.update" title="修改"/>
			    <u:dropView name="delete" template="delete" onClick="ReportPage.delete" title="删除"/>
			</u:dropListView>
			<u:dataSet id="reportInfoSet">
				<u:dataField name="reportId" display="报表ID" visiable="false"/>
				<u:dataField name="reportKey" display="报表KEY" width="220px"/>
				<u:dataField name="reportName" display="报表名称"/>
				<u:dataField name="reportCategory" display="所属业务" dropdown="codeSet.reportCategory"/>
				<u:dataField name="reportJson" display="报表JSON对象" visiable="false"/>
				<u:dataField name="reportDesc" display="描述"/>
			    <u:dataField name="oper" dropView="dropView_oper" display="操作"/>
			</u:dataSet>
			<!-- 获取报表信息列表ajax -->
			<lui:ajax id="findByPageAjax" url="${ctx }/report/find/page" formQuery="#reportFrm" />
			<lui:datatable id="datatable" ajax="findByPageAjax" sortable="true" pagination="pagination" dataset="reportInfoSet" checkable="true"
			    multiple="false" cutLine="true" onItemClick="ReportPage.onItemClick" onDoubleClick="ReportPage.update"/>
			<lui:pagination datatable="datatable" id="pagination" pageSize="15" pageChoice="15" showPageChoice="false"/>
			<lui:ajax id="deleteByIdAjax" url="${ctx }/report/delete/id/" type="post" onSuccess="ReportPage.onDeleteSucc"/>
        </form>
    </lui:board>
    <lui:board width="40%" boardTitle="报表参数">
    	<form id="reportParamsFrm" class='m-cust'>
		    <sys:dropCodeSet codeTypes="reportCategory" id="codeSet"/>
        	<div class="form-group row m-narrow">
			    <div class="col-sm-6 col-md-6 col-xs-6">
			    	<div class="input-group">
					    <label for="reportKey" class="input-group-addon">参数KEY</label>
					    <input name="reportKey" id="reportKey" type="text" class="form-control">
					</div>
			    </div>
			    <div class="col-sm-6 col-md-6 col-xs-6">
			    	<div class="input-group">
					    <label for="reportName" class="input-group-addon">参数名称</label>
					    <input name="reportName" id="reportName" type="text" class="form-control">
					</div>
			    </div>
			</div>
        	<div class="form-horizontal">
			    <div class="form-group">
			        <div class="col-md-12 col-sm-12">
			            <div class="btn-group">
			                <button type="button" class="btn btn-primary" onclick="ReportPage.findParamsByCondition()"><i class='fa fa-fw fa-search'></i>查询</button>
			                <button type="button" class="btn btn-info" onclick="ReportPage.addParams()"><i class='fa fa-fw fa-plus'></i>新增</button>
			                <button type="reset" class="btn btn-default"><i class='fa fa-fw fa-repeat'></i>重置</button>
			            </div>
			        </div>
			    </div>
			</div>
			<u:dropListView id="dropParamsView_oper">
			    <u:dropView name="update" template="edit" onClick="ReportPage.updateParams" title="修改参数"/>
			    <u:dropView name="delete" template="delete" onClick="ReportPage.deleteParams" title="删除参数"/>
			</u:dropListView>
			<u:dataSet id="reportParamsSet">
				<u:dataField name="reportId" display="报表ID" visiable="false"/>
				<u:dataField name="paramName" display="参数中文名称" align="left"/>
				<u:dataField name="paramKey" display="参数KEY" align="left"/>
				<u:dataField name="paramValue" display="参数值" width="220px" align="left"/>
				<u:dataField name="oper" dropView="dropParamsView_oper" display="操作"/>
			</u:dataSet>
			<input hidden="hidden" name="reportId">
			<!-- 获取报表信息列表ajax -->
			<lui:ajax id="findParamsByPageAjax" url="${ctx }/report/params/find/page" formQuery="#reportParamsFrm" />
			<lui:datatable id="paramsDatatable" ajax="findParamsByPageAjax" sortable="true" pagination="paramsPagination" dataset="reportParamsSet" 
				checkable="true" multiple="false" cutLine="true" automatic="false" />
			<lui:pagination datatable="paramsDatatable" id="paramsPagination" pageSize="15" pageChoice="15" showPageChoice="false"/>
			<lui:ajax id="deleteParamsByIdAjax" url="${ctx }/report/params/delete/paramKey/" type="post" onSuccess="ReportPage.onDeleteParamsSucc"/>
        </form>
    </lui:board>
</lui:boards>
</body>
</u:View>
</html>